package com.clps.cn;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.TaskService;
import org.junit.Test;

public class ActiviteComplateTask {
    public static void main(String[] args) {
        ProcessEngine defaultProcessEngine = ProcessEngines.getDefaultProcessEngine();

        TaskService taskService = defaultProcessEngine.getTaskService();

        /**
         * task.getProcessInstanceId() = 2501
         * task.getId() = 2505
         * task.getAssignee() = zhangsan
         * task.getName() = 填写请假单
         * task.getProcessInstanceId() = 5001
         * task.getId() = 5005
         * task.getAssignee() = zhangsan
         * task.getName() = 填写请假单
         */
        //handler task
        taskService.complete("2505");
    }

    @Test
    public void test0Lisi() {

        /**
         *
         task.getProcessInstanceId() = 2501
         task.getId() = 7502
         task.getAssignee() = lisi
         task.getName() = 部门经理审批
         */
        ProcessEngine defaultProcessEngine = ProcessEngines.getDefaultProcessEngine();
        TaskService taskService = defaultProcessEngine.getTaskService();
        taskService.complete("5002");
    }



    @Test
    public  void  wangwuTaskComplate(){
        ProcessEngine defaultProcessEngine = ProcessEngines.getDefaultProcessEngine();
        TaskService taskService = defaultProcessEngine.getTaskService();
        taskService.complete("7502");
    }
}
